<%@ page language="java" contentType="text/html; charset=utf-8"
	pageEncoding="utf-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ page import="admin.*"%>
<%@ page import="java.util.*" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<!-- 상단프레임 -->
<%@ include file="/Dmyna/admin/head.jsp"%>
<p>

<%
	String oi_no = request.getParameter("id");
	AdminOrderManager manager = AdminOrderManager.getInstance();
	AdminOrderItem order = manager.select(Integer.parseInt(oi_no));
	List<AdminOrderItem> orderlist = manager.selectOrderList(Integer.parseInt(oi_no));
%>

<!--  -->
<c:set var="order" value="<%=order%>" />
<c:set var="list" value="<%=orderlist%>" />

<!-- 상단제목 -->
<table width="900" align=center cellpadding=0 cellspacing=0>
	<tr>
		<td>
			<div
				style="border:1px solid #ddd; height:34px; background:url(${WEB_ROOT }/img/bbs/title_bg.gif) repeat-x;">
				<div
					style="font-weight: bold; font-size: 14px; margin: 7px 0 0 10px;"
					align="center">::&nbsp;&nbsp;주문 정보&nbsp;&nbsp;::</div>
			</div>
		</td>
	</tr>
</table>
<p>
<table width="900" border="1" align="center" bordercolor="#f0f0f0">
	<tr>
		<td align="center" width="20%" bgcolor="#DFDFDF">주문번호</td>
		<td align="center" width="30%">${order.oi_no }</td>
		<td align="center" width="20%" bgcolor="#DFDFDF">주문일자</td>
		<td align="center" width="30%">${order.oi_date }</td>
	</tr>
	<tr>
		<td align="center" bgcolor="#DFDFDF">주문자</td>
		<td align="center">${order.mb_name }</td>
		<td align="center" bgcolor="#DFDFDF">주문처리상태</td>
		<td align="center">아래 상품리스트 참조</td>
	</tr>
</table>

<br />
<br />

<table width="900" border="1" align="center" bordercolor="#f0f0f0">
	<tr>
		<td colspan="4">[배송지정보]</td>
	</tr>
	<tr>
		<td align="center" width="20%" bgcolor="#DFDFDF">수취인</td>
		<td align="center" width="30%">${order.mb_name }</td>
		<td align="center" width="20%" bgcolor="#DFDFDF">연락처</td>
		<td align="center" width="30%">${order.mb_tel } /
			${order.mb_phone }</td>
	</tr>
	<tr>
		<td align="center" bgcolor="#DFDFDF">주소</td>
		<td align="center" colspan="3">${order.oi_addr }</td>
	</tr>
</table>

<br />
<br />

<table width="900" border="" align="center" bordercolor="#f0f0f0">
	<tr>
		<td colspan="7">[상품리스트]</td>
	</tr>
	<tr align="center" bgcolor="#DFDFDF">
		<td width="10%">배송구분</td>
		<td width="10%">이미지</td>
		<td>상품명</td>
		<td width="10%">수량</td>
		<td width="10%">판매가</td>
		<td width="10%">총판매가</td>
	</tr>
	<c:if test="${empty list }">
		<tr>
			<td bgcolor="#f0f0f0" colspan="6" height="100" align="center">주문한 상품이 없습니다.</td>
		</tr>
	</c:if>

	<c:if test="${!empty list }">
		<c:forEach var="orderlist" items="${list }">
			<tr bgcolor="#f0f0f0">
				<c:set var="bgChk" value="${ (cnt % 2) == 0 ? 0 : 1 }" />
			<tr class="bg${bgChk }">
			<tr align="center">
				<td>기본배송</td>
				<td><img src="${WEB_ROOT }/admin/goods/upload/small.${orderlist.gs_img }" height="50" width="50"/></td>
				<td>${orderlist.gs_name } (색상 : ${orderlist.od_color } / 사이즈 : ${orderlist.od_size })</td>
				<td>${orderlist.od_cnt }</td>
				<td>${orderlist.od_goods_price }</td>
				<td>${orderlist.od_total_price }</td>
			</tr>
		</c:forEach>
	</c:if>
	<tr>
		<td colspan="6" align="right">[상품구매금액] : ${order.oi_price }
			+ [배송비] : 2500 = [총구매액] :
			${order.oi_total_price }원</td>
	</tr>
</table>

<br />
<br />

<table width="900" border="1" align="center" bordercolor="#f0f0f0">
	<tr>
		<td colspan="6" align="center">상품구매금액 : ${order.oi_price }원
			+ 배송비 : 2500원 = [총구매액] : ${order.oi_total_price }원</td>
	</tr>
	<tr>
		<td colspan='6' height=25 align=right>
		<a href="${WEB_ROOT }/admin/order/orderList.jsp"> 
			<img src="${WEB_ROOT }/img/bbs/btn_list.gif" border='0'>
		</a>
		</td>
	</tr>
</table>
<br />
<br />
<%@ include file="/Dmyna/admin/tail.jsp"%>
